home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / clone_object < prev    next >
Text File  |  2001-04-06  |  2KB  |  49 lines

  1. SYNOPSIS
  2.         object clone_object(string name)
  3.         object clone_object(object template)
  4.  
  5. DESCRIPTION
  6.         Clone a new object from definition <name>, or alternatively from
  7.         the object <template>. In both cases, the new object is given
  8.         an unique name and returned.
  9.  
  10.         The original, called blueprint, used for cloning, should not be
  11.         used in the system, just for cloning. The cloned objects
  12.         contain only the data but the blueprint also the function code.
  13.         The blueprint is the one without a unique number at the end of
  14.         the object's name. The clone_object() function never
  15.         returns a blue print.
  16.  
  17.         If the blueprint exists and has a heart_beat(), clone_object()
  18.         turns it off.
  19.         
  20.         Note that the pathname must be complete, which means there are no
  21.         relative paths allowed.
  22.  
  23.         If strict euids are enforced, the cloning object must have
  24.         a non-zero euid.
  25.  
  26. EXAMPLE
  27.         // Clone a torch (filename in non-compat format)
  28.         object torch;
  29.         torch = clone_object("/obj/torch");
  30.  
  31.         // Clone two keys (filename in compat format)
  32.         object key1, key2;
  33.         key1 = clone_object(load_object("obj/key"));
  34.         key2 = clone_object(key1);
  35.  
  36. BUGS
  37.         If variable initialization is not done with __INIT(), the initializers
  38.         are copied from the _current_ variables of the blueprint. This is in
  39.         line with the meaning of 'blueprint', but can lead to hard-to-find
  40.         errors. Variables without initializer are unaffected and always
  41.         initialized to 0.
  42.  
  43. HISTORY
  44.         Modified in LDMud 3.2.6 to take an object as argument.
  45.  
  46. SEE ALSO
  47.         clonep(E), destruct(E), clones(E), load_name(E), load_object(E),
  48.         move_object(E), uids(C), program_name(E)
  49.